package com.natalia.file.service;

import com.natalia.file.entity.*;
import io.minio.messages.Part;
import org.springframework.core.io.InputStreamSource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.context.request.WebRequest;

import java.util.List;


/**
 * @Author yang
 **/
public interface FileService {

    /**
     *
     * @return 上传文件
     */
    UploadResult upload(UploadInfo uploadInfo);

    /**
     * @return 下载文件
     */
    ResponseEntity<InputStreamSource> download(String fileId, WebRequest request);

    /**
     * @return 初始化分片上传
     */
    MultipartUploadInfo createMultipartInit(MultipartInit multipartInit);

    /**
     *
     * @return 上传分片文件
     */
    MultipartUploadInfo uploadPart(UploadPartInfo uploadPartInfo);

    /**
     *
     * @return 查询分片信息
     */
    List<ShardUploadInfo> listParts(MultipartUploadCreate uploadCreate);

    /**
     *
     * @return 合并分片文件
     */
    CompleteUploadInfo completeMultipart(CompleteMultipart request);
}
